package cn.edu.controller;

import cn.edu.entity.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;
import java.util.Set;

@Controller
@RequestMapping("/user")
public class UserController {



    @RequestMapping("/test06")
    public String test06(User user){
        Set<Map.Entry<String, User>> entries = user.getMaps().entrySet();
        for (Map.Entry<String, User> entry : entries) {
            System.out.println(entry.getKey() + "====" + entry.getValue());
        }
        return "success";
    }

    @RequestMapping("/test05")
    public String test05(User user){
        for (User u : user.getList()) {
            System.out.println(u);
        }
        return "success";
    }

    @RequestMapping("/test04")
    public String test04(User user){
        System.out.println(user);
        return "success";
    }


    @RequestMapping("/test03")
    public String test03(User user){
        System.out.println(user);
        return "success";
    }



    @RequestMapping("/test02")
    public String test02(@RequestParam("name") String username){
        System.out.println(username);
        return "success";
    }


    @RequestMapping("/test01")
    public String test01(String name){
        System.out.println(name);
        return "success";
    }




    @RequestMapping("/reg.user")
    public String reg(){
        System.out.println("reg.....");
        return "";
    }
    @RequestMapping("/login.user")
    public String login(){
        System.out.println("login...");
        return "";
    }
}
